#include <stdio.h>
#include "findposbinary.h"

#define TEST_ARRAY_SIZE 8

static int test_array[TEST_ARRAY_SIZE] = {
  10,
  5,
  11,
  0,
  1,
  -1,
  -100,
  1000
};


static int test_sort_array[TEST_ARRAY_SIZE] = {
  -100,
  -10,
  0,
  1,
  10,
  15,
  100,
  1000
};



int main()
{
  int index = 0;
  int find_value = 10;
  int insert_value = 3;
  FindPosBinary<int> findpos;
  
  printf("Before sorting:\n");
  for(index = 0; index < TEST_ARRAY_SIZE; index ++)
  {
    printf("array[%d] = %d\n", index, test_array[index]);
  }
  
  findpos.sort(test_array, TEST_ARRAY_SIZE);
  
  printf("After sorting:\n");
  for(index = 0; index < TEST_ARRAY_SIZE; index ++)
  {
    printf("array[%d] = %d\n", index, test_array[index]);
  }

  printf("Find pos for: %d  is: %d\n", find_value, findpos.findPos(test_array, TEST_ARRAY_SIZE, find_value));
  printf("Insert pos for: %d  is: %d\n", insert_value, findpos.insert2Pos(test_array, TEST_ARRAY_SIZE, insert_value));



  return 0;
}
